<!-- SearchByRegion index -->

<link href='<?php echo CSS_URL ?>page/AIC.page.SearchByRegion.css' rel='stylesheet' type='text/css' />

<script src='<?php echo JS_URL ?>page/AIC.page.SearchByRegion.js' type='text/javascript'></script>
<script src='<?php echo JS_URL ?>_Shared/jquery.validate.js' type='text/javascript'></script>

<div class="header"><h1>Eldercare Service Locator</h1></div>

<?php include VIEW_PATH . '_Shared/search/searchNavigation.php' ?>

<div class="module_header"><h2>Search by Region
		<a href="<?php echo BASE_URL ?>SearchByRegion/SearchByMap" title="Search By Map">
			<img alt="Search By Map" src="<?php echo IMAGE_URL ?>_Shared/btn_searchMap.gif" />
		</a>
	</h2></div>

<b>Select any of the services below (You may select more than 1 type of service)<b/>
	<br/>
	<br/>

	<form id='frmSearch' action='<?php echo BASE_URL ?>SearchByRegion/Search' method='post'>

		<?php include VIEW_PATH . '_Shared/search/serviceList.php' ?> <!--	element: chkServiceType -->

		<div id='btnSelectAllServices' name='btnSelectAll' title="Select All Services" >Select All Services</div>
<!--		<div id='btnReset' name='btnReset' title="Reset fields" >Reset</div>-->



		<br/><br/>
		Search by Location
		<br/>
		<?php 
			foreach ($regionList as $key => $value) {
				$data = array( 'name' => "chkRegion[]" , 'id' => 'chkRegion_' . $key , 'value' => $key , 'title' => $value , 'class' => 'chkRegion' );
				echo form_checkbox($data);
				echo form_label( " " . $value . " " , 'chkRegion_' . $key );
			}
		?>
		

		<br/><br/>
		Estate (Catchment Area)
		<br/>
		Please select the region to choose your catchment area.
		<br/><br/>
		(Hold Ctrl and Click to select multiple estates)
		<br/>
		<?php 
			$options = array();
			foreach ($estateList->result() as $row) {
				//$options[ $row->parent_id ][ $row->OBJECT_NAME ] = $row->OBJECT_NAME;
				$regionName = $regionList[ $row->parent_id ] ;
				$options[ $regionName ][ $row->OBJECT_NAME ] = $row->OBJECT_NAME;
			}
			
			$option_groups = array();
			foreach ($options as $key => $value) {
				array_push ( $option_groups , $key ) ;
			}
			echo form_hidden('hidRegions', $option_groups );
			echo form_multiselect('lstEstate[]', $options , '' , 'size="5" class="lstEstate"');
			
		?>

		<br/>
		<div id='btnSelectAllEstates' name='btnSelectAllEstates' title="Select All Estates" >Select All Estates</div>
		<div id='btnReset' name='btnReset' title="Reset fields" >Reset</div>
		<br/><br/>

		<?php include VIEW_PATH . '_Shared/search/organisationTypeButtons.php' ?>
		<!--element : hidOrganisationType , btnSearchVoluntaryOrganisation , btnSearchPrivateOrganisation
		, btnSearchGovernmentOrganisation , btnSearchAllOrganisation-->

		<hr>
		
		
		
		</form->


		<br/><br/>
		<span class='red'>*</span> <span class='note'>Represents mandatory fields</span>
		
